/*inheritance*/
#include"conio.h"
#include"stdio.h"
#include"iostream"
using namespace std;
class CRectangle
{
protected:
	int width, height;
public:
	void setValues(int a, int b);
public:
	int area();
};
void CRectangle::setValues(int a, int b)
{
	width=a;
	height=b;
}
int CRectangle::area()
{
	return (width*height);
}
class CTriangle
{
protected:
	int width, height;
public:
	void setValues(int a, int b );
	int area();
};
void CTriangle::setValues(int a, int b)
{
	width=a;
	height=b;
}
int CTriangle::area()
{
	return(width*height/2);
}
int main()
{
	CRectangle rect;
	CTriangle trgl;
	rect.setValues(4,5);
	trgl.setValues(4,5);
	cout<<"rect:"<<rect.area()<<endl;
	cout<<"\ntrgl:"<<trgl.area()<<endl;
	getch();
	return 0;
}